package club.lovety.code.dal.service;

import club.lovety.code.dal.mapper.UserMapper;
import com.google.common.util.concurrent.*;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.concurrent.*;

/**
 * <p>
 * 这里写有象视频代码描述
 * </p>
 * @author sunmc
 * @date created in 2018/4/24 19:47
 * @since
 */
@Service
public class Userservice {

    @Resource
    private UserMapper userMapper;

    public ExecutorService executorService = Executors.newFixedThreadPool(5);

    public void testJunit() throws ExecutionException, InterruptedException {
//        executorService.execute(()->{
//            try{
//                int count = userMapper.queryCount();
//                System.out.println("count: "+ count);
//            }catch (Exception ex){
//                ex.printStackTrace();
//            }
//        });
//        Future<Integer> future = executorService.submit(()->{
//           return  userMapper.queryCount();
//        });
//
//        System.out.println("result: "+ future.get());



    }

}
